package com.ibm.cps.processors;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;

public abstract class ProcessorDeletion {
	abstract public List<String> deleteAffectedProcessors(String deletedId,
			HashMap<String, Set<String>> parent2Successors);

	public List<String> deleteAffectedProcessors(List<String> deletedIds,
			HashMap<String, Set<String>> parent2Successors) {
		if (deletedIds == null) {
			return null;
		}
		List<String> result = new ArrayList<String>();
		for (String deletedId : deletedIds) {
			result.addAll(deleteAffectedProcessors(deletedId, parent2Successors));
		}
		if (result.size() >= 1) {
			return result;
		} else {
			return null;
		}
	}
}
